/*
 * Copyright (c) 2023.
 *
 * 作者：bmy
 * 邮箱：2271608011@qq.com
 * gitee：https://gitee.com/bmycode
 * github：https://github.com/helpcode
 *
 */

import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart";
import Notification from "./Notification";

export default class AutoStart {

  /**
   * 注册开机自启
   */
  public static async EnableAutoStart() {
    if (!await isEnabled()) {
      await enable();
      await Notification.send({ title: '恭喜', body: '已注册开机自启' })
    }
  }

  /**
   * 禁用开机自启
   */
  public static async DisableAutoStart() {
    await disable();
    await Notification.send({ title: '恭喜', body: '已关闭开机自启' })
  }

}